//respokaneGloGetObjectOffset :: returns the offset for a select object in GPoint format (x,y)
function respokaneGloGetObjectOffset(refobj) 
{
	//figure out y
	var y = refobj.offsetTop;
	var obj = refobj.offsetParent;
	while (obj != null) 
	{
		y += obj.offsetTop;
		obj = obj.offsetParent;
	}
	//figure out x
	var x = refobj.offsetLeft;
	var obj = refobj.offsetParent;
	while (obj != null) 
	{
		x += obj.offsetLeft;
		obj = obj.offsetParent;
	}
	//return g point
	return new GPoint(x,y);
}

//respokaneGloGetObject :: returns a reference to a document element if available
function respokaneGloGetObject(id)
{
	if( document.getElementById(id) )
		return document.getElementById(id);
	return null;
}

//respokaneGloShowHide :: simple method to show hide an elem
function respokaneGloShowHide(elemObj)
{
	if( elemObj != null && typeof(elemObj) != "undefined" )
	{
		if (elemObj.style.display == "none")
			elemObj.style.display = "inline";  
		else
			elemObj.style.display = "none";
	}
}

function glCheckInt(numberVal){
	if (isNaN(numberVal) || numberVal == "")
	{
		return false;
	}
	else
	{
		if (numberVal.indexOf('.') != -1)
		{
			return false;
		}
		else
		{
			if(numberVal>=0)
				return true;
			else
				return false;
		}
	}
}

function glCheckFloat(numberVal){
	if (isNaN(numberVal) || numberVal == "") {
		return false;
	}else{
		return true;
	}
}

function glCheckRealInt(numberVal)
{
	if (isNaN(numberVal) || numberVal == "")
	{
		return false;
	}
	else
	{
		if (numberVal.indexOf('.') != -1)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}

